<template>
  <div class="t-input">
    <el-input
      ref="input"
      type="textarea"
      :autosize="{ minRows: 1 }"
      resize="none"
      v-model="moduleValue"
      size="small"
      :disabled="disabled"
      @input="handleChange"
    ></el-input>
  </div>
</template>
<script>
export default {
  name: "TNumber",
  props: {
    value: {
      type: [String, Number],
      default: "",
      require: true,
    },
    disabled: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {};
  },
  computed: {
    moduleValue: {
      get() {
        return this.value;
      },
      set(val) {
        this.$emit("input", val);
      },
    },
  },
  methods: {
    focus() {
      const input = this.$refs.input;
      if (input) {
        input.focus();
      }
    },
    handleChange(value) {
      this.$emit("change", value)
    }
  },
};
</script>
<style lang="scss" scoped></style>
